#include <iostream>
using namespace std;
//必须是成员函数
//没有返回类型
//没有参数
//在函数执行体中必须要返回目标类型的变量
class MyCin{
public:
    MyCin(int good,int bad,int fail,int eof)
        :_good(good)
        ,_bad(bad)
        ,_fail(fail)
        ,_eof(eof){}
    operator bool(){
        return _fail != 1;
    }
private:
    int _good;
    int _bad;
    int _fail;
    int _eof;
};
void test(){
MyCin cin(0,0,0,0);
if(cin){
    cout<<"Cin is good"<<endl;
}else{
    cout<<"Cin is bad"<<endl;
}
}
int main()
{
    test();
    return 0;
}

